class CharacterReader
  def initialize file
	@file_path = file
  end

  def occurences
	dict = Hash.new(0);
	File.open(@file_path, "r") do |f|
	  while c = f.getc
	    dict[c.chr] = dict[c.chr].to_i + 1
	  end
	end
	return dict.keys.map{|k| [dict[k], k]}.sort{|a,b| b <=> a}
  end
end
